package com.pulse.base.service.impl;

import com.pulse.base.domain.CircuitThreshold;
import com.pulse.base.mapper.CircuitThresholdMapper;
import com.pulse.base.service.ICircuitThresholdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName CircuitThresholdServiceImpl
 * @Description
 * @Author 陆帅
 * @Date 2024/9/25 15:25
 */
@Service
public class CircuitThresholdServiceImpl implements ICircuitThresholdService {

    @Autowired
    private CircuitThresholdMapper circuitThresholdMapper;

    /**
     * 根据设备编号和通道号查询阈值信息
     *
     * @param deviceNo
     * @param channel
     * @return
     */
    @Override
    public CircuitThreshold selectThresholdByDeviceNoAndChannel(String deviceNo, Integer channel) {
        return circuitThresholdMapper.selectThresholdByDeviceNoAndChannel(deviceNo,channel);
    }

    /**
     * 修改阈值
     *
     * @param circuitThreshold
     * @return
     */
    @Override
    public int updateThreshold(CircuitThreshold circuitThreshold) {
        return circuitThresholdMapper.updateCircuitThreshold(circuitThreshold);
    }

    /**
     * 插入
     *
     * @param circuitThreshold
     * @return
     */
    @Override
    public int insertThreshold(CircuitThreshold circuitThreshold) {
        return circuitThresholdMapper.insertCircuitThreshold(circuitThreshold);
    }

    /**
     * 根据设备编号删除
     *
     * @param deviceNo
     * @return
     */
    @Override
    public int deleteByDeviceNo(String deviceNo) {
        return circuitThresholdMapper.deleteCircuitThresholdByDeviceNo(deviceNo);
    }
}
